<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>AOS傲雄在线--注册</title>
    <link href="layui/css/layui.css" rel="stylesheet">
    <!--<link rel="stylesheet" href="static/css/style.css" media="all">-->
    <link rel="stylesheet" href="static/css/register.css"/>
    <script type="text/javascript" src="static/js/jquery.min.js"></script>
    <script type="text/javascript" src="static/js/jquery.cookie.js"></script>

    <script src="static/js/base.js" charset="utf-8"></script>
    <script src="static/js/ax.js" charset="utf-8"></script>
    <script src="static/js/avalon.js" charset="utf-8"></script>
    <!--[if lt IE 9]>
    <script src="static/js/html5.js"></script>
    <script src="static/js/respond.js"></script>
    <![endif]-->
</head>
<body ms-controller="register">
<div class="hearder" >
    <div class="layui-container">
        <div class="logo">
            <img src="static/images/logo.png"/>
        </div>
        <ul class="layui-row register_list">
            <li class="layui-col-sm2 on"><h3><span>1</span><i></i></h3><p>服务类型</p></li>
            <li class="layui-col-sm2" :class="(@servetype >1 ?'on':'')"><h3><span>2</span><i></i></h3><p>企业信息</p></li>
            <li class="layui-col-sm2" :class="(@servetype >2 ?'on':'')"><h3><span>3</span><i></i></h3><p>联系人信息</p></li>
            <li class="layui-col-sm2" :class="(@servetype >3 ?'on':'')"><h3><span>4</span><i></i></h3><p>提交申请</p></li>
            <li class="layui-col-sm2" :class="(@servetype >4 ?'on':'')"><h3><span>5</span></h3><p>完成信息</p></li>
        </ul>
    </div>

</div>
<div class="layui-container">
    <div class="layui-form-pane register_wrap" :visible="@servetype==1">
        <!--服务类型--->
        <div class="servetype">
            <div class="layui-row">
                <div class="layui-col-sm4 sevtype1" ms-click="@typyclick(1)">
                    <img src="static/images/regist_img1.jpg"/>
                    <h4>直营总校</h4>
                    <p>自营总校有自己的分校和</br>报名点分别管理</p>
                </div>
                <div class="layui-col-sm4 sevtype2" ms-click="@typyclick(2)">
                    <img src="static/images/regist_img2.jpg"/>
                    <h4>非直营总校</h4>
                    <p>非直营总校单独管理</p>
                </div>
                <div class="layui-col-sm4 sevtype3" ms-click="@typyclick(4)">
                    <img src="static/images/regist_img3.jpg"/>
                    <h4>报名点</h4>
                    <p>报名点对学员信息的管理</br>报名点账号的申请必须要挂靠总校</p>
                </div>
            </div>
        </div>
    </div>
        <!--服务类型--->
    <form class="layui-form-pane layui-form register_wrap" :visible="@servetype==2">

        <!--企业信息--->
        <div class="enterprise" >
            <div class="layui-form-item" :if="@bmdshow==1">
                <label class="layui-form-label">所属总校代码</label>
                <div class="layui-input-block">
                    <input type="text" name="code" :blur="getzxname()" lay-verify="required|num" :duplex="@zxcode" class="layui-input" placeholder="驾校代码">
                </div>
            </div>
            <div class="layui-form-item" :if="@bmdshow==1">
                <label class="layui-form-label">总校名称</label>
                <div class="layui-input-block">
                    <input type="text" name="zxname" :duplex="@zxname" lay-verify="required|num" class="layui-input" placeholder="驾校名称" disabled>
                    <input type="hidden" name="parentId" :duplex="@parentId">
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">企业名称</label>
                <div class="layui-input-block">
                    <input type="text" name="name" lay-verify="required" class="layui-input" placeholder="需与工商营业执照上的企业名称一致">
                </div>
            </div>
            <div class="layui-form-item" :if="@bmdshow==2">
                <label class="layui-form-label">驾校代码</label>
                <div class="layui-input-block">
                    <input type="number" name="code" lay-verify="required|num" maxlength="10" class="layui-input" placeholder="*驾校代码唯一，只能输入数字，10字符内">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">营业执照注册号</label>
                <div class="layui-input-block">
                    <input type="text" name="licensenumber" lay-verify="required|licensenumber" class="layui-input" placeholder="请输入15位营业执照注册号或18位统一社会信用号">
                </div>
            </div>
            <div class="layui-form-item" pane="">
                <label class="layui-form-label" style="line-height: 145px;">上传营业执照</label>
                <div class="layui-input-block" style="padding: 20px;">
                    <!--<input type="hidden" ms-attr="{value:@licenimg}" lay-verify="required|img">-->
                    <div class="layui-upload-drag" id="License" style="padding: 0;">
                        <i class="layui-icon layui-icon-picture" style="color:#999999; padding: 30px;display: block;" :if="@licens==1"></i>
                        <img style="width: 110px;height: 110px;" :if="@licens==2" ms-attr="{src:@licensenPics} " alt="">
                    </div>
                </div>
            </div>
            <div class="layui-form-item Verification">
                <label class="layui-form-label">验证码</label>
                <div class="layui-input-block">
                    <input type="text" name="Verification" :blur="yzcode()" :duplex="@vscode" lay-verify="required" class="layui-input" placeholder="验证码">
                    <img ms-attr="{src:@VerificationCode}" title="点击刷新" alt="如果看不清楚，请单击图片刷新！" :click="getvercode()">
                </div>
            </div>
            <h5 class="layui-form-item" :if="@bmdshow==2">驾校地址</h5>
            <h5 class="layui-form-item" :if="@bmdshow==1">报名点地址</h5>
            <div class="layui-row address">
                <div class="layui-col-sm4">
                    <div class="layui-form-item">
                        <label class="layui-form-label">省份</label>
                        <div class="layui-input-block">
                            <select id="Province" name="provinceId" lay-verify="required" lay-filter="provinceSelect">
                                <option value="0">选择</option>
                                <option ms-attr="{value: el.code}" ms-for="($index, el) in @provlist">{{el.name}}</option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="layui-col-sm4">
                    <div class="layui-form-item">
                        <label class="layui-form-label">市辖</label>
                        <div class="layui-input-block">
                            <select id="City" name="cityId" lay-filter="regionSelect" :duplex="@cityid">
                                <option value="0">选择</option>
                                <option ms-attr="{value: el.code}" ms-for="($index, el) in @regionlist">{{el.name}}</option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="layui-col-sm4">
                    <div class="layui-form-item">
                        <label class="layui-form-label">区域</label>
                        <div class="layui-input-block">
                            <select id="region" name="areaId">
                                <option value="0">选择</option>
                                <option ms-attr="{value: el.code}" ms-for="($index, el) in @arealist">{{el.name}}</option>
                            </select>
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-row">
                <div class="layui-col-sm7">
                    <div class="layui-form-item">
                        <label class="layui-form-label">详细地址</label>
                        <div class="layui-input-block" style="position: relative;">
                            <input type="text" name="address" ms-duplex="@address" lay-verify="required" class="layui-input" placeholder="营业执照注册号" :blur="@getlanglat()">
                            <input type="hidden" name="longitude" ms-attr="{value:@longitude}">
                            <input type="hidden" name="latitude" ms-attr="{value:@latitude}">
                            <a class="layui-btn layui-btn-radius add_btn" style="position: absolute; right: 5px; top: 4px; height: 30px; line-height: 30px;" >搜索</a>
                        </div>
                    </div>
                </div>
                <div class="layui-col-sm5">
                    <div class="layui-form-item">
                        <label class="layui-form-label">所属管辖</label>
                        <div class="layui-input-block">
                            <select id="jurisdiction" name="divisionId" lay-verify="required">
                                <option value="">选择</option>
                                <option ms-attr="{value: el.id}" ms-for="($index, el) in @divisionlist">{{el.name}}</option>
                            </select>
                        </div>
                    </div>
                </div>
            </div>
            <h5 class="layui-form-item">驾校图片</h5>
            <div class="layui-upload layui-form-item driveimg">
                <!--<input type="hidden" lay-verify="required|img1" ms-attr="{value:@imgs}">-->

                <blockquote class="layui-elem-quote layui-quote-nm" style="margin-top: 10px;">
                    <div class="layui-upload-list" id="demo2" style="margin: 0;">
                        <div class="imglist" ms-for="($index, el) in @show_pics" style="width: 140px;height: 140px;position: relative;float: left;margin-right: 15px;margin-bottom: 15px">
                            <i :click="removeimg($index)" class="layui-icon layui-icon-close-fill" style="font-size: 20px; color: red;position: absolute;right: -10px;top: -10px;z-index: 10;"></i>
                            <img style="width: 140px;height: 140px;" ms-attr="{src:el} " alt="">
                        </div>
                    </div>
                    <button type="button" class="layui-btn" id="test2"></button>
                </blockquote>
                <div style="clear: both;"></div>

                <p>图片上传不能超过10张<span>为保障您信息的真实性，我们需要您提供几张驾校的照片</span></p>
            </div>

            <div class="layui-form-item check">
                <input type="checkbox" name="" id="read" lay-verify="checkboxmustbe">
                <label for="read">我同意并遵守《平台服务协议》</label>
            </div>

            <div class="layui-form-item change">

                <a class="layui-btn preve" :click="@preve()">上一步</a>
                <button class="layui-btn add_btn next" lay-submit="" lay-filter="demo1">下一步</button>
                <!--<a class="layui-btn add_btn next" :click="@next()">下一步</a>-->

            </div>

        </div>
        <!--企业信息--->
    </form>

    <form class="layui-form-pane layui-form register_wrap" :visible="@servetype==3">
        <!--联系人信息--->
        <div class="Contacts">
            <div class="layui-form-item">
                <label class="layui-form-label">业务联系人</label>
                <div class="layui-input-block">
                    <input type="text" name="contacts" lay-verify="required" class="layui-input" placeholder="业务联系人">
                </div>
            </div>

            <div class="">
                <label class="layui-form-label">手机号</label>
                <div class="layui-input-block" style="position: relative;">
                    <input type="text" name="mobile" lay-verify="required|phone" :duplex="@username" class="layui-input" placeholder="手机号">
                    <a class="layui-btn-radius layui-btn add_btn" style="position: absolute; right: 5px; top: 4px; height: 30px; line-height: 30px;" :click="telcode()" :visible="!@timeshow">获取验证码</a>
                    <a class="layui-btn-radius layui-btn add_btn" style="position: absolute; right: 5px; top: 4px; height: 30px; line-height: 30px;" :visible="@timeshow">{{@timecode}}</a>

                    <p style="text-align: right; font-size: 14px; color: #333;line-height: 36px;">手机号将会作为登录账号</p>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">验证码</label>
                <div class="layui-input-block">
                    <input type="text" name="Contactscode" :duplex="@telcodes" :blur="yztelcode()" lay-verify="required" class="layui-input" placeholder="验证码">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">密码</label>
                <div class="layui-input-block">
                    <input type="text" name="password" :duplex="@passworde" id="password" lay-verify="required|password" class="layui-input" placeholder="密码">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">确认密码</label>
                <div class="layui-input-block">
                    <input type="text" name="confirmPwd" lay-verify="required|confirmPwd" class="layui-input" placeholder="确认密码">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">电子邮箱</label>
                <div class="layui-input-block">
                    <input type="text" name="email" lay-verify="required|email" class="layui-input" placeholder="电子邮箱">
                    <p style="text-align: right; font-size: 14px; color: #333;line-height: 36px;">用于密码重置和接收重要信息提示</p>
                </div>
            </div>
            <div class="layui-form-item change" style="text-align: center;">
                <a class="layui-btn preve" :click="@preve()">上一步</a>
                <!--<a class="layui-btn add_btn next" :click="@next()">下一步</a>-->
                <button class="layui-btn add_btn next" lay-submit="" lay-filter="demo2">下一步</button>

            </div>
        </div>
        <!--联系人信息--->
    </form>

    <form class="layui-form-pane layui-form register_wrap" :visible="@servetype==4">
        <!--提交申请--->
        <div class="Submission" >
            <h6>完成注册还差最后一步：</h6>
            <h2>请在本机上插入车管所分配的加密U盘，进行账号绑定<input type="hidden" name="usbKey" lay-verify="required" value="123456"/></h2>
            <h2>请在本机上插入122数字证书设备，进行账号认证！<input type="hidden" name="devicecode" lay-verify="required" value="799776442432"/></h2>
            <div>
                <a class="layui-btn layui-btn-danger">重新检测</a>
            </div>
            <p>注意：注册时绑定的122数字证书，提交学员信息时将用此数字证书认证的驾校提交。</p>
            <div class="layui-form-item change" style="text-align: center;">
                <a class="layui-btn preve" :click="@preve()">上一步</a>
                <!--<a class="layui-btn add_btn next" :click="@next()">下一步</a>-->
                <button class="layui-btn add_btn next" lay-submit="" lay-filter="demo3">下一步</button>

            </div>

        </div>
        <!--提交申请--->
    </form>
    <div class="register_wrap" :visible="@servetype==5">
        <!--完成注册--->
        <div class="complete">
            <h2>恭喜您注册成功！</br><span>请耐心等待审核结果！</span></h2>
            <div class="complete_main">
                <div class="layui-row">
                    <div class="layui-col-md6">您的账号为：{{@username}}</div>
                    <div class="layui-col-md6">您的密码为：{{@passworde}}</div>
                </div>
            </div>
            <p>请您妥善保管您的账号以免丢失！登录平台可查看审核状态</p>
            <h4><a class="layui-btn add_btn" href="login.html">立即登录</a></h4>
            <h6><a>关于我们</a> | <a>联系我们</a></h6>
        </div>
        <!--完成注册--->
    </div>




    <div class="login_btn" :if="@servetype!=5">
        <a href="login.html" class="layui-btn add_btn btn-left">立即登录</a>
        <label class="btn-left">已有账号</label>
    </div>



</div>
<script src="layui/layui.js" charset="utf-8"></script>
<script>

    var vm = avalon.define({
        $id: "register",
        servetype:1,//判断步骤流程
        type:'',//驾校类型
        provinceid:'',//省份id
        provlist:[],//省份列表
        cityid:'',//城市id
        arealist:[],//城市列表
        regionlist:[],//区县列表
        address:'',//地址
        longlat:'',//经纬度
        longitude:'',//经纬度
        latitude:'',//经纬度
        show_pics:[],//驾校图片
        licensenPics:'',//营业执照
        licensenPicsid:'',//营业执照注册号
        divisionlist:[],
        licens:1,//营业执照
        pics:[],//驾校图片
        form1data:{},
        form2data:{},
        form3data:{},
        username:'',
        passworde:'',
        bmdshow:'',
        zxcode:'',
        zxinfolist:{},
        zxname:'',
        parentId:'',
        imgs:'',
        licenimg:'',
        VerificationCode:'',//图形验证码
        vscode:'',
        telcodes:'',//验证码
        timecode:'',//验证码倒计时
        timeshow:false,//验证码倒计时显隐

        //驾校类型
        typyclick:function(a){
            vm.servetype=2;
              vm.type=a;
            vm.bminfo();
            setTimeout(function () {
                upload.render();
                form.render();
            },200)
        },
        //获取验证码
        getvercode:function(){
           vm.VerificationCode=schoolWebUrl+ systemhl +"/api/captcha/getcaptcha?rnd="+Math.random();
        },
        //验证图形验证码
        yzcode:function(){
            ax.post({
                url: schoolWebUrl+ systemhl +'/api/captcha/checkPicMessage',
                contentType: "application/x-www-form-urlencoded",
                data:{code:vm.vscode},
                success: function (r) {
                    console.log(r)
                }
            });
        },
        //获取手机验证码
        telcode:function(){
            var reg=/^1[3|4|5|7|8][0-9]{9}$/;
            if(reg.test(vm.username)){
                ax.post({
                    url: backendWebUrl+ systemhl +'/api/apply/sendSmsMessage',
                    contentType: "application/x-www-form-urlencoded",
                    data:{phone:vm.username},
                    success: function (r) {
                        if(r.code==0){
                            //调用倒计时函数
                            vm.reserveCode();
                            setTimeout(function () {
                                vm.timeshow=true;
                            },200)

                        }
                        console.log(r)
                    }
                });

            }else {
                layer.msg("手机号格式错误")
            }
        },

        reserveCode: function (){
            var time=60;
            var timer=setInterval(function(){
                vm.timecode=time--+'秒后重新获取';

                //60s后停止定时器
                if(time===0){
                    vm.timeshow=false;
                    vm.timecode=60;
                    clearInterval(timer);
                }
            },1000)
        },

        yztelcode:function(){
            ax.post({
                url: backendWebUrl+ systemhl + '/api/apply/checkSmsMessage',
                contentType: "application/x-www-form-urlencoded",
                data:{phone:vm.username,code:vm.telcodes},
                success: function (r) {
                    if(r.code!=0){
                        layer.msg('验证码错误');
                    }

                }
            });
        },

        // 获取省份
        getprovlist: function () {
            ax.post({
                url:schoolWebUrl + systemhl + '/api/captcha/getRegionProvince',
                contentType: "application/x-www-form-urlencoded",
                data: '',
                success: function (r) {
                    vm.provinceid = r.data[0].code;
                    vm.provlist = r.data;
                    vm.getRegionlist();
                },
            });
        },
        // 获取市
        getRegionlist: function () {
            ax.post({
                url: schoolWebUrl +systemhl + '/api/captcha/getRegionCodeHl',
                contentType: "application/x-www-form-urlencoded",
                data: { "code": vm.provinceid },
                success: function (r) {
                    vm.cityid = r.data[0].code;
                    vm.regionlist = r.data;
                    setTimeout(function () {
                        form.render('select');
                    },200)
                    vm.getArealist();
                },
            });
        },
        // 获取区县
        getArealist: function () {
            // $('#areaId').empty();
            ax.post({
                url: schoolWebUrl +systemhl +  '/api/captcha/getRegionCodeHl',
                contentType: "application/x-www-form-urlencoded",
                data: { "code": vm.cityid },
                success: function (r) {
                    vm.arealist = (r.data);
                    setTimeout(function () {
                        form.render('select');
                    },200)
                },
            });
        },
        // 获取经纬度
        getlanglat: function () {
            var address = vm.address;
            $.ajax({
                type: 'get',
                url: ' https://restapi.amap.com/v3/geocode/geo?key=930ccb3f2c1982cbfbe33c328869ae40&address=' + address,
                success: function (r) {
                    if (r.status == 1) {
                        var langlat = r.geocodes[0].location.split(',');
                        vm.longlat = r.geocodes[0].location;
                        vm.longitude = langlat[0];
                        vm.latitude = langlat[1];

                    } else {
                        layer.alert("地址输入错误请重新输入");
                    }
                }
            });
        },
        //所属管辖
        division: function () {
            ax.post({
                url: schoolWebUrl+ systemhl +'/api/division/info',
                contentType: "application/x-www-form-urlencoded",
                data: { "cityId": vm.cityid },
                success: function (r) {
                     console.log(r)
                    if (r.code == 0) {
                         vm.divisionlist=r.data;
                        setTimeout(function () {
                            form.render('select');
                        },200)

                    } else {

                    }
                }
            });
        },

        //删除图片
        removeimg: function (index) {
            // console.log(index)
            vm.show_pics.removeAt(index);
            vm.pics.removeAt(index);
        },

        //上一步
        preve:function () {
            vm.servetype=vm.servetype-1;
            vm.bminfo();
        },
        //下一步
        next:function () {
             vm.servetype=vm.servetype+1;
            vm.bminfo();
        },
        //报名点
        bminfo:function () {
            if(vm.type==4){
                vm.bmdshow=1;
            }else {
                vm.bmdshow=2;
            }
        },
        //获取总校名称
        getzxname:function () {
            ax.post({
                url: backendWebUrl+ systemhl +'/api/apply/gatherNameByCode',
                contentType: "application/x-www-form-urlencoded",
                data: { "code": vm.zxcode},
                success: function (r) {
                     console.log(r)
                    if (r.code == 0) {
                         if(r.data==null){
                             layer.msg(r.message)
                         }else {
                             vm.zxinfolist=r.data;
                             vm.zxname=r.data.name;
                             vm.parentId=r.data.id;
                         }

                    } else {
                        layer.msg(r.message)
                    }
                }
            });
        }

    })
    vm.$watch('onReady', function () {
        //获取省市区
        vm.getprovlist();
        // vm.getGather();
        vm.bminfo();
        //获取验证码
        vm.getvercode();

    });
    vm.$watch('cityid', function () {
        vm.division()

    });
    vm.$watch('cityid', function () {
        vm.division()

    });

    var table;
    var form;
    var upload;
    var License;

    layui.use(['table','form','laydate','layer','upload'], function() {
        table = layui.table;
        form = layui.form;
        upload = layui.upload;
         var laydate = layui.laydate,
             layer=layui.layer,
             $ = layui.jquery;

        //营业执照
        License=ax.upload({
            elem: '#License'
            ,url: indexUploadUrl + "?appId=" + appId + "&userId=" + currentUserId + "&type=" + type
            ,done: function(res){
                console.log(getCookie(currentUserId))
                console.log(indexShowUrl + '?id=' + res.data);
                vm.licensenPics=indexShowUrl + '?id=' + res.data;
                vm.licensenPicsid=res.data
                vm.licens=2;
                vm.licenimg=1;
            }
        });
        //省改变
        form.on('select(provinceSelect)', function (data) {
            vm.provinceid = data.value;
            vm.getRegionlist();
            vm.division();
        });
        // 市改变
        form.on('select(regionSelect)', function (data) {
            vm.cityid = data.value;
            vm.getArealist();
            vm.division();
        });
        //图片上传
        var License = ax.upload({

            elem: '#test2',
            url: indexUploadUrl + "?appId=" + appId + "&userId=" + currentUserId + "&type=" + type,
            before: function (obj) {
                //预读本地文件示例，不支持ie8
                /*obj.preview(function(index, file, result){
                    $('#demo1').attr('src', result); //图片链接（base64）
                });*/


            },
            done: function (res) {
                //上传成功
                console.log(indexShowUrl + '?id=' + res.data)
                if (vm.show_pics.length >= 10) {
                    layer.msg('最多上传10张图片');
                    return;
                }
                vm.imgs=1;
                vm.show_pics.push(indexShowUrl + '?id=' + res.data)
                vm.pics.push(res.data)
            }
        });

        //添加验证规则
        form.verify({

            password : function(value, item){
                var   re = /^[a-zA-Z0-9]{6,16}$/;
                var result=  re.test(value);
                if(!result) {
                    return "密码至少包含字母数字，且不少于6位";
                }
            },
            confirmPwd : function(value, item){
                if(!new RegExp($("#password").val()).test(value)){
                    return "两次输入密码不一致，请重新输入！";
                }
            },
            num:function (value, item) {
                if(value.length >10){
                    return "驾校代码不能超过10个字符";
                }
            },
            licensenumber:[/(^(?:(?![IOZSV])[\dA-Z]){2}\d{6}(?:(?![IOZSV])[\dA-Z]){10}$)|(^\d{15}$)/,'请输入15位营业执照注册号或18位统一社会信用号'],
            checkboxmustbe: function (value) {
                if (!$("#read").is(":checked")) {
                    return "请同意并遵守《平台服务协议》";
                }
            },
            img:function (value) {
                if(value==''){
                    return '请上传营业执照'
                }
            },
            img1:function (value) {
                if(value==''){
                    return '请上传驾校图片'
                }
            }
        });

        form.on('submit(demo1)', function(data){
            console.log(data.field);
            vm.form1data=data.field;
            console.log(vm.form1data);
            vm.next();
            return false;
            //
            // layer.alert(JSON.stringify(data.field), {
            //     title: '最终的提交信息'
            // })

        });

        form.on('submit(demo2)', function(data){
            console.log(data.field);
            vm.form2data=(data.field);
            console.log(vm.form1data);
            vm.next();
            return false;
        });

        form.on('submit(demo3)', function(data){
            console.log(data.field);
            // data.field.push(vm.form1data);
            data.field.name=vm.form1data.name;
            data.field.licensenumber=vm.form1data.licensenumber;
            data.field.provinceId=vm.form1data.provinceId;
            data.field.cityId=vm.form1data.cityId;
            data.field.areaId=vm.form1data.areaId;
            data.field.address=vm.form1data.address;
            data.field.longitude=vm.form1data.longitude;
            data.field.latitude=vm.form1data.latitude;
            data.field.divisionId=vm.form1data.divisionId;
            data.field.licensenPics=vm.licensenPicsid;
            data.field.parentId=vm.parentId

            data.field.contacts=vm.form2data.contacts;
            data.field.mobile=vm.form2data.mobile;
            data.field.password=vm.form2data.password;
            data.field.email=vm.form2data.email;
            // data.field.contacts=vm.form2data.contacts;
            if(vm.type>2){
                data.field.code='';
            }else {
                data.field.code=vm.form1data.code;
            }

            var pics = vm.pics
            data.field.schoolPics = pics.join(',');
            data.field.type=vm.type;
            ax.post({
                url: backendWebUrl +systemhl + "/api/apply/applySchool",
                data: data.field,
                contentType: "application/x-www-form-urlencoded",
                success: function (data) {
                    layer.msg(data.message);
                    if (data.code == 0) {
                        //刷新父页面
                        vm.next();
                        // parent.location.reload();
                    } else {

                    }
                }
            });
            return false;
        });


    });




</script>
</body>
</html>
